package com.tangmu.rabbits.ui.activity.mine;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.tangmu.rabbits.R;
import com.tangmu.rabbits.adapter.mine.IntegralDetailsAdapter;
import com.tangmu.rabbits.base.BaseActivity;
import com.tangmu.rabbits.constants.Constants;
import com.tangmu.rabbits.widget.ListDividerDecoration;
import com.tangmu.rabbits.widget.ThumbnailView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 积分明细
 */
public class IntegralDetailsActivity extends BaseActivity {


    @BindView(R.id.iv_header_left)
    ThumbnailView ivHeaderLeft;
    @BindView(R.id.tv_header_title)
    TextView tvHeaderTitle;
    @BindView(R.id.iv_header_right)
    ThumbnailView ivHeaderRight;
    @BindView(R.id.integral_recyclerView)
    RecyclerView mRecyclerView;
    private IntegralDetailsAdapter adapter;
    private List<Integer> datas = new ArrayList<>();

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        mImmersionBar.statusBarColor(R.color.transparent).titleBar(R.id.headerView).init();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_integral_details;
    }

    @Override
    protected void initPresenter() {

    }

    @Override
    protected void initView() {
        setHeaderImage(Constants.Position.LEFT, R.drawable.icon_back, false, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        setHeaderTitle("积分明细");

        for (int i = 0; i < 10; i++) {
            datas.add(i);
        }

        mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        mRecyclerView.setNestedScrollingEnabled(false);
        mRecyclerView.setFocusableInTouchMode(false);
        mRecyclerView.requestFocus();
        mRecyclerView.addItemDecoration(new ListDividerDecoration(mContext, R.color.line_e_color, 1));
        adapter = new IntegralDetailsAdapter(mContext, datas);
        mRecyclerView.setAdapter(adapter);
    }

}
